<%--
  Created by IntelliJ IDEA.
  User: 叶叶
  Date: 2022/2/20
  Time: 20:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>内部生产查询</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://unpkg.com/bootstrap-table@1.15.3/dist/bootstrap-table.min.css">
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
    <script src="https://unpkg.com/bootstrap-table@1.15.3/dist/bootstrap-table.min.js"></script>
    <script src="../js/bootstrap-table-zh-CN.min.js"></script>
</head>
<body>
<div class="container" id="div1">
    <span style="color: blue;font-family: 华文宋体"><marquee width=400 direction=left align=middle><span>您正在做的业务是：生产管理--内部生产管理--生产查询

</span></marquee></span>
    <div class="row">
        <form class="form-inline">
            <div class="container" style="margin: 10px">
                <input class="form-control" type="text" id="manufactureId" placeholder="请输入派工单编号">
                <input class="form-control" type="text"  id="productName" placeholder="请输入关键字">
                <select class="form-control" id="checkTag">
                    <option value="">请选择派工状态</option>
                    <option value="S001-0">等待</option>
                    <option value="S001-1">完成</option>
                </select>
                <span style="font-family: 华文中宋">建档时间:</span><input class="form-control" type="date" id="registerTime1"><span>至</span>
                <input class="form-control" type="date" id="registerTime2">
                <input type="button" class="btn btn-primary" id="submit_select" value="查询" >
                <!--                  <button class="btn btn-primary" id="submit_select">查询</button>-->
            </div>
        </form>
    </div>
    <!--      <div class="row" style="margin-top: 20px">-->
    <!--          <div class="col-10">-->
    <!--          </div>-->
    <!--          <div class="col-2">-->
    <!--              <button class="btn btn-primary" data-toggle="modal" data-target="#myModal" onclick="add1()">添加</button>-->
    <!--          </div>-->
    <!--      </div>-->
    <div class="container">
        <caption>
            <div style="float: right;margin-bottom: 5px">
            </div>
        </caption>
        <div class="row">
            <table id="table" class="table table-hover table-bordered" style="width: 1100px">
                <thead>

                </thead>
                <tbody>

            </table>
        </div>
    </div>
</div>
</div>
</div>
</div>
<script>
    $(function () {
        $("#table").bootstrapTable({
            method:"post",
            contentType:"application/json",
            url:"/cha/chanbsy/",
            //初始页数
            pageNumber:1,
            pagination: true,
            sidePagination:"server",
            pageSize:2,
            pageList:[2,4,6,8,10],
            queryParams:function (param) {
                return {
                    page: (param.offset / param.limit) + 1,
                    pageNum: param.limit,
                    manufactureId:document.getElementById("manufactureId").value,
                    productName:document.getElementById("productName").value,
                    checkTag:document.getElementById("checkTag").value,
                    registerTime1:document.getElementById("registerTime1").value,
                    registerTime2:document.getElementById("registerTime2").value
                }
            },
            columns:[
                {title:"派工单编号",field:"manufactureId",align:"center"},
                {title:"产品编号",field:"productId",align:"center"},
                {title:"产品名称",field:"productName",align:"center"},
                {title:"数量",field:"amount",align:"center"},
                {title:"合格品数量",field:"testedAmount",align:"center",formatter:function (value) {
                        if (value==null){
                            return "生产中"
                        }
                    }},
                {title:"派工单状态",field:"checkTag",align:"center",formatter:function (value) {
                        if (value=='S001-0'){
                            return "执行"
                        }
                        if (value=='S001-1'){
                            return "完成"
                        }
                        if (value=='S001-2'){
                            return "不通过"
                        }
                    }},
                {title:"生产状态",field:"manufactureProcedureTag",align:"center",formatter:function (value) {
                        if (value=='S002-0'){
                            return "执行"
                        }
                        if (value=='S002-1'){
                            return "执行"
                        }
                        if (value=='S002-2'){
                            return "完成"
                        }
                    }},
            ]
        })
        $("#submit_select").click(function () {
            $("#table").bootstrapTable("refresh");
        })
    })
</script>
</body>
</html>
